package com.student.service.impl;

import com.student.mapper.StudentMapper;
import com.student.model.Room;
import com.student.model.Student;
import com.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired//自动注入
    private StudentMapper studentMapper;

    @Override
    public Student getInforById(Integer stuId) {
        Student student = studentMapper.getStudentInfoById(stuId);
        return student;
    }

    @Override
    public int insertStudent(Student student) {
        int count = studentMapper.insertStudent(student);
        return count;
    }

    @Override
    public int deleteInforById(Integer stuId) {
        int count = studentMapper.deleteInforById(stuId);
        return count;
    }

    @Override
    public List<Student> getAllStudents() {
        return studentMapper.getAllStudent();
    }

    @Override
    public int putstudentInfo(Student student) {
        int count = studentMapper.putstudentInfo(student);
        return count;
    }
}
